<?php
namespace Addons\RedPackets\Controller;
class IndexController extends \Addon
{
    public function __construct()
    {
        parent::__construct();
        
    }

    
    public function  getRedPackets($id){
					 $id=intval($id)?$id:I('id',"0","intval");
					 $data=BoxModel("addon_red_packets")->where(array('id'=>$id))->find();
						if($data['user_id'] != $this->user_id){
							  echo json_encode(array('error'=>1,'msg'=>'您没有权限操作'));
						}
						/******领取经包***/
						$r=BoxModel("addon_red_packets")->getRedPackets($id);
						echo json_encode($r);
				}
 
	 
				//我的待领取的红包
				public function my_list(){
					 $data=BoxModel("addon_red_packets")->get(array('user_id'=>$this->user_id,'status'=>1));
						$this->display();
				}
     


}